Xbasic

CLIP_SHAPE Function

Syntax

V CLIP_SHAPE([C shape_name,[N XPos,[N YPos]]])

Arguments

shape_name

The name of a previously created shape. Character

XPos

The horizontal coordinate of the last point of the polygon. Larger values move right. Numeric

YPos

The vertical coordinate of the last point of the polygon. Larger values move down. Numeric

Description

CLIP_SHAPE() defines a shape boundary for all subsequent bitmap drawing. Used only in the Code sections of UI_BITMAP_DRAW(), UI_SCREEN_DRAW(), and UI_PRINTER_DRAW(). All drawing after will be clipped to the shape.

Example

ui_bitmap_load("stone", file.to_blob("C:\WINDOWS\Greenstone.bmp"))
ui_bitmap_create("test", 4, 2)
ui_shape_oval("oval", 0, 0, 4, 2)
ui_bitmap_draw("test", 
clip_shape("oval", 0, 0)
bitmap("stone", 0, 0, 4, 2)
%code%)
ui_dlg_box("", "{image=test}")

See Also